import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm';
import { BaseEntity } from './base.entity';
import { Workspace } from './workspace.entity';

@Entity('tags')
export class Tag extends BaseEntity {
  @Column()
  name: string;

  @Column()
  color: string;

  @Column({ name: 'workspace_id' })
  workspaceId: string;

  @ManyToOne(() => Workspace)
  @JoinColumn({ name: 'workspace_id' })
  workspace: Workspace;
} 